<?php

class Skjb_Validate_Array extends Zend_Validate_Abstract
{
    const INVALID = 'arrayInvalid';
    const NOT_ARRAY = 'notArray';

    protected $_messageTemplates = array(
        self::INVALID => "Invalid type given, value should be array",
        self::NOT_ARRAY => "'%value%' does not appear to be an array",
    );

    public function isValid($value)
    {
        if (!is_array($value)) {
            $this->_error(self::INVALID);
            return false;
        }

        return true;
    }
}
